<template>
    <div class="content-wrap" v-if="post_content" v-html="post_content"></div>
</template>

<script>
export default {
  name: 'ArticleContent',
  data: function () {
    return {
      post_content: ''
    }
  },
  created() {
    const { id } = this.$route.query;
    this.$store.dispatch('getArticleContent', id)
    .then(result => {
      this.post_content = result.post_content
      this.$route.meta.title = result.title
    }).catch(err => {
      console.log(err);
    })
  }
}
</script>

<style lang="less" scoped>
.content-wrap {
  padding: 15px;
}
</style>
